package com.logistics.map.entity.domain;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.TableName;
import com.logistics.map.entity.model.MapRouteNodesSave;
import com.logistics.utils.tool.StringUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 
 * </p>
 *
 * @author zhiyu.fan
 * @since 2024-06-03
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("lgs_map_route_nodes")
public class MapRouteNodes implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private String routeCode;

    private String type;

    private String clazz;

    private BigDecimal x;

    private BigDecimal y;

    private String uuid;

    public MapRouteNodes(){

    }

    public MapRouteNodes(MapRouteNodesSave save){
        this.routeCode = save.getRouteCode();
        this.type = save.getType();
        this.clazz = save.getClazz();
        this.x = new BigDecimal(save.getX());
        this.y = new BigDecimal(save.getY());
        this.uuid = save.getUuid();
    }

    public static MapRouteNodes build(MapRouteNodesSave save){
        return new MapRouteNodes(save);
    }
}
